-
Notifications
You must be signed in to change notification settings - Fork 0
Salt simulation elements #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…k together with the salt simulation mixin.
3ca71f5 to
de38b4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces salt simulation capabilities to the RTC-Tools Channel Flow package by adding a new Salt package containing elements for modeling advective and dispersive salt transport in water systems. These components are designed to work with the salt_simulation_mixin from the rtc-tools-simulation package and are intended for simulation only, not optimization.
Key changes:
- Added new
Saltpackage with reservoir, node, and structure elements for salt transport modeling - Implemented UNESCO EOS-80 equation for seawater density calculations based on salinity and temperature
- Created specialized forcing and storage elements supporting mass transport alongside volume flow
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| package.order (ChannelFlow) | Registered new Salt package in module hierarchy |
| Salt/package.mo | Root package definition for salt simulation components |
| Salt/package.order | Declared Elements subpackage |
| Salt/Elements/package.mo | Elements subpackage definition |
| Salt/Elements/package.order | Listed all salt simulation element classes |
| SubstanceControlledStructure.mo | Structure element implementing density-driven flow with UNESCO EOS-80 calculations |
| SaltyPartialStorage.mo | Base class for storage elements with mass balance |
| SaltyPartialReservoirBnd.mo | Boundary reservoir base class (zero derivatives) |
| SaltyPartialReservoir.mo | Standard reservoir base class with mass and volume conservation |
| SaltyLinearReservoirBnd.mo | Linear reservoir boundary implementation |
| SaltyLinearReservoir.mo | Linear reservoir implementation with forcing |
| QMForcing.mo | Forcing class for volume and mass flow inputs |
| NodeSalty.mo | Node element connecting reservoirs with mass conservation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| model SubstanceControlledStructure "SubstanceControlledStructure" | ||
| /* | ||
| This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport | ||
| between salty reservoir elements, do not user in optimization. |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'user' to 'use'.
| between salty reservoir elements, do not user in optimization. | |
| between salty reservoir elements, do not use in optimization. |
| partial model SaltyPartialStorage | ||
| /* | ||
| This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport | ||
| between salty reservoir elements, do not user in optimization. |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'user' to 'use'.
| between salty reservoir elements, do not user in optimization. | |
| between salty reservoir elements, do not use in optimization. |
| model SaltyLinearReservoirBnd | ||
| /* | ||
| This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport | ||
| between salty reservoir elements, do not user in optimization. |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'user' to 'use'.
| between salty reservoir elements, do not user in optimization. | |
| between salty reservoir elements, do not use in optimization. |
| model SaltyLinearReservoir | ||
| /* | ||
| This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport | ||
| between salty reservoir elements, do not user in optimization. |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'user' to 'use'.
| between salty reservoir elements, do not user in optimization. | |
| between salty reservoir elements, do not use in optimization. |
| model NodeSalty | ||
| /* | ||
| This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport | ||
| between salty reservoir elements, do not user in optimization. |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'user' to 'use'.
| between salty reservoir elements, do not user in optimization. | |
| between salty reservoir elements, do not use in optimization. |
| parameter Integer n_QForcing(min = 0) = 0; | ||
| replaceable package medium = Deltares.ChannelFlow.Media.FreshWater; | ||
| input SI.VolumeFlowRate QForcing[n_QForcing]; | ||
| input SI.VolumeFlowRate MForcing[n_QForcing]; |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable MForcing represents mass flow rate but is typed as VolumeFlowRate. Consider using SI.MassFlowRate for MForcing to accurately reflect the physical quantity.
| input SI.VolumeFlowRate MForcing[n_QForcing]; | |
| input SI.MassFlowRate MForcing[n_QForcing]; |
This branch contains blocks that are used to model advective and dispersive salt transport. They are only used in simulation, together with salt_simulation_mixin from the rtc-tools-simulation package.